<script setup>
import { RouterLink, RouterView } from 'vue-router'
</script>

<template>
  <div class="app-container">
    <!-- 导航栏 -->
    <nav class="navbar">
      <div class="container">
        <div class="navbar-brand">
          <RouterLink to="/" class="brand-link">
            <img alt="Logo" class="logo" src="./assets/logo.svg" width="40" height="40" />
            <span class="brand-name">我们的平台</span>
          </RouterLink>
        </div>
        <div class="navbar-menu">
          <RouterLink to="/" class="nav-link">首页</RouterLink>
          <RouterLink to="/products" class="nav-link">产品</RouterLink>
          <RouterLink to="/about" class="nav-link">关于我们</RouterLink>
        </div>
      </div>
    </nav>

    <!-- 主要内容区域 -->
    <main class="main-content">
      <RouterView />
    </main>

    <!-- 页脚 -->
    <footer class="footer">
      <div class="container">
        <div class="footer-content">
          <div class="footer-about">
            <h3>关于我们</h3>
            <p>我们致力于为用户提供高品质的产品和卓越的服务体验。</p>
          </div>
          <div class="footer-links">
            <h3>快速链接</h3>
            <ul>
              <li><RouterLink to="/" class="footer-link">首页</RouterLink></li>
              <li><RouterLink to="/products" class="footer-link">产品</RouterLink></li>
              <li><RouterLink to="/about" class="footer-link">关于我们</RouterLink></li>
            </ul>
          </div>
          <div class="footer-contact">
            <h3>联系我们</h3>
            <p>电话：400-123-4567</p>
            <p>邮箱：contact@example.com</p>
          </div>
        </div>
        <div class="footer-bottom">
          <p>&copy; 2023 我们的平台. 保留所有权利。</p>
        </div>
      </div>
    </footer>
  </div>
</template>

<style scoped>
.app-container {
  width: 100%; box-sizing: border-box;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%; box-sizing: border-box;
}

/* 导航栏样式 */
.navbar {
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;

}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: #333;
}

.brand-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #667eea;
}

.navbar-menu {
  display: flex;
  gap: 20px;
}

.nav-link {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  padding: 8px 15px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.nav-link:hover {
  color: #667eea;
  background-color: #f8f9fa;
}

/* 主要内容区域 */
.main-content {
  flex: 1;
  width: 100%;
}

/* 页脚样式 */
.footer {
  background-color: #333;
  color: white;
  padding: 40px 0;
  width: 100%;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-about h3,
.footer-links h3,
.footer-contact h3 {
  margin-bottom: 20px;
  font-size: 1.2rem;
}

.footer-about p,
.footer-contact p {
  color: #ccc;
  line-height: 1.6;
}

.footer-links ul {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-link {
  color: #ccc;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: white;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #444;
  color: #999;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .navbar .container {
    flex-direction: column;
    gap: 15px;
    padding: 10px 20px;
  }
  
  .navbar-menu {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
  }
  
  .nav-link {
    padding: 6px 12px;
    font-size: 0.9rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}
</style>